/*
  +----------------------------------------------------------------------+
  | PHP Version 5                                                        |
  +----------------------------------------------------------------------+
  | Copyright (c) 1997-2007 The PHP Group                                |
  +----------------------------------------------------------------------+
  | This source file is subject to version 3.0 of the PHP license,       |
  | that is bundled with this package in the file LICENSE, and is        |
  | available through the world-wide-web at the following url:           |
  | http://www.php.net/license/3_0.txt.                                  |
  | If you did not receive a copy of the PHP license and are unable to   |
  | obtain it through the world-wide-web, please send a note to          |
  | license@php.net so we can mail you a copy immediately.               |
  +----------------------------------------------------------------------+
  | Authors: Wang Wenlin <wl AT soplwang DOT com>                        |
  +----------------------------------------------------------------------+
*/

#ifndef PHP_BADWORDS_H
#define PHP_BADWORDS_H

extern zend_module_entry badwords_module_entry;
#define phpext_badwords_ptr &badwords_module_entry

#ifdef PHP_WIN32
#	define PHP_BADWORDS_API __declspec(dllexport)
#elif defined(__GNUC__) && __GNUC__ >= 4
#	define PHP_BADWORDS_API __attribute__ ((visibility("default")))
#else
#	define PHP_BADWORDS_API
#endif

#ifdef ZTS
#include "TSRM.h"
#endif

#include "ext/standard/php_smart_str_public.h"

PHP_MINIT_FUNCTION(badwords);
PHP_RINIT_FUNCTION(badwords);

PHP_FUNCTION(badwords_filter);
PHP_FUNCTION(badwords_ifilter);
PHP_FUNCTION(badwords_detect);
PHP_FUNCTION(badwords_idetect);
PHP_FUNCTION(badwords_find);
PHP_FUNCTION(badwords_ifind);

#define PHP_BADWORDS_VERSION "0.1.1"

/* our globals */
ZEND_BEGIN_MODULE_GLOBALS(badwords)
	void *_badwords_cache;
ZEND_END_MODULE_GLOBALS(badwords)

#if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION >= 3)
#   define IS_CALLABLE(cb_zv, flags, cb_sp) zend_is_callable((cb_zv), (flags), (cb_sp) TSRMLS_CC)
#else
#   define IS_CALLABLE(cb_zv, flags, cb_sp) zend_is_callable((cb_zv), (flags), (cb_sp))
#endif

#ifdef ZTS
#define BADWORDS_G(v) TSRMG(badwords_globals_id, zend_badwords_globals *, v)
#else
#define BADWORDS_G(v) (badwords_globals.v)
#endif

#ifndef ZSTR
#define ZSTR
#endif

#endif	/* PHP_BADWORDS_H */

/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * End:
 * vim600: noet sw=4 ts=4 fdm=marker
 * vim<600: noet sw=4 ts=4
 */
